package com.xbongbong.pro.rabbitmq.producer.impl;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.CollectionsUtil;
import com.xbongbong.pro.enums.errorcodes.MessageErrorCodeEnum;
import com.xbongbong.pro.message.enums.PushTypeEnum;
import com.xbongbong.pro.message.pojo.dto.MessageRabbitMqDTO;
import com.xbongbong.pro.rabbitmq.binders.CrmProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.DataCenterProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.DistributorProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.JxcProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.MarketActivityProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.MarketingManagementProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.OfficeProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.OrderCenterProducerBinder;
import com.xbongbong.pro.rabbitmq.binders.SfaProducerBinder;
import com.xbongbong.pro.rabbitmq.producer.BaseProducer;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.messaging.support.MessageHeaderAccessor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * 基本生产者的实现
 * @author 魏荣杰
 * @date 2019/2/25 15:36
 * @since v1.0
 * @version v1.0
 */
@Service("baseProducer")
@EnableBinding({CrmProducerBinder.class, JxcProducerBinder.class, OfficeProducerBinder.class, SfaProducerBinder.class,DistributorProducerBinder.class,OrderCenterProducerBinder.class,MarketActivityProducerBinder.class,MarketingManagementProducerBinder.class, DataCenterProducerBinder.class})
public class BaseProducerImpl implements BaseProducer {
    private static final String HEADER_NAME = "type";
    @Resource
    private CrmProducerBinder crmBinder;
    @Resource
    private JxcProducerBinder jxcBinder;
    @Resource
    private OfficeProducerBinder officeBinder;
    @Resource
    private SfaProducerBinder sfaBinder;
    @Resource
    private MarketActivityProducerBinder marketActivityBinder;
    @Resource
    private DataCenterProducerBinder dataCenterProducerBinder;
    @Resource
    private DistributorProducerBinder distributorProducerBinder;
    @Resource
    private OrderCenterProducerBinder orderCenterProducerBinder;
    @Resource
    private MarketingManagementProducerBinder marketingManagementProducerBinder;

    @Override
    public void sendMessage(PushTypeEnum pushTypeEnum, MessageRabbitMqDTO message) throws XbbException{
        if (CollectionsUtil.isEmpty(message.getUserIds())) {
            //目前发现太多推送人为空的消息进入mq，前置拦截
            return;
        }
        MessageBuilder messageBuilder;
        MessageHeaderAccessor messageHeaderAccessor = new MessageHeaderAccessor();
        Object header;
        if (Objects.nonNull(pushTypeEnum) && Objects.nonNull(message)) {
            switch (pushTypeEnum) {
                case CUSTOMER_PUSH:
                    //目前不使用  @date 2019/2/25 16:05  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CUSTOMER_ADD_PUSH:
                    header = PushTypeEnum.CUSTOMER_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_CHANGE_PUSH:
                    header = PushTypeEnum.CUSTOMER_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_HANDOVER_PUSH:
                    header = PushTypeEnum.CUSTOMER_HANDOVER_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerHandoverOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_DISTRIBUTION_PUSH:
                    header = PushTypeEnum.CUSTOMER_DISTRIBUTION_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerDistributionOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_BACK_PUBLIC:
                    // 无，该枚举为推送配置枚举，不是实际推送用枚举
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CUSTOMER_TEAM_ADD_DEL_MAIN:
                    header = PushTypeEnum.CUSTOMER_TEAM_ADD_DEL_MAIN;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_TEAM_ADD_DEL_SYNERGETIC:
                    header = PushTypeEnum.CUSTOMER_TEAM_ADD_DEL_SYNERGETIC;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_REMIND:
                    //客户自定义提醒走轮询  @date 2019/2/25 16:06  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CUSTOMER_STAGE:
                    header = PushTypeEnum.CUSTOMER_STAGE;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.customerOutput().send(messageBuilder.build());
                    break;
                case CUSTOMER_BACK_PUSH:
                    // TODO: 2019/2/25
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CUSTOMER_WILL_BACK_PUSH:
                    // TODO: 2019/2/25
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CONTACT_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CONTACT_NEW:
                    header = PushTypeEnum.CONTACT_NEW;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.contactOutput().send(messageBuilder.build());
                    break;
                case OPPORTUNITY_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case OPPORTUNITY_ADD_PUSH:
                    header = PushTypeEnum.OPPORTUNITY_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.opportunityOutput().send(messageBuilder.build());
                    break;
                case OPPORTUNITY_CHANGE_PUSH:
                    header = PushTypeEnum.OPPORTUNITY_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.opportunityOutput().send(messageBuilder.build());
                    break;
                /*case OPPORTUNITY_HANDOVER_PUSH:
                    header = PushTypeEnum.OPPORTUNITY_HANDOVER_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.opportunityHandoverOutput().send(messageBuilder.build());
                    break;*/
                case OPPORTUNITY_EXPIRE_PUSH:
                    //销售机会到期提醒 走轮询  @date 2019/2/25 16:06  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case OPPORTUNITY_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.OPPORTUNITY_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.opportunityOutput().send(messageBuilder.build());
                    break;
                case OPPORTUNITY_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.OPPORTUNITY_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.opportunityOutput().send(messageBuilder.build());
                    break;
                case OPPORTUNITY_STAGE_PUSH:
                    header = PushTypeEnum.OPPORTUNITY_STAGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.opportunityOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_PLAN_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case COMMUNICATE_PLAN_ADD_PUSH:
                    header = PushTypeEnum.COMMUNICATE_PLAN_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicatePlanOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case COMMUNICATE_ADD_PUSH:
                    header = PushTypeEnum.COMMUNICATE_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicateOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_LIKE_PUSH:
                    header = PushTypeEnum.COMMUNICATE_LIKE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicateOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_COMMENT_PUSH:
                    header = PushTypeEnum.COMMUNICATE_COMMENT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicateOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_REPLY_PUSH:
                    header = PushTypeEnum.COMMUNICATE_REPLY_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicateOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_AT_PUSH:
                    header = PushTypeEnum.COMMUNICATE_AT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicateOutput().send(messageBuilder.build());
                    break;
                case COMMUNICATE_COMMENT_DEL_PUSH:
                    header = PushTypeEnum.COMMUNICATE_COMMENT_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.communicateOutput().send(messageBuilder.build());
                    break;
                case QUOTATION_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case QUOTATION_ADD_PUSH:
                    header = PushTypeEnum.QUOTATION_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.quotationOutput().send(messageBuilder.build());
                    break;
                case QUOTATION_CHANGE_PUSH:
                    header = PushTypeEnum.QUOTATION_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.quotationOutput().send(messageBuilder.build());
                    break;
                case QUOTATION_STATUS_PUSH:
                    header = PushTypeEnum.QUOTATION_STATUS_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.quotationOutput().send(messageBuilder.build());
                    break;
                case QUOTATION_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.QUOTATION_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.quotationOutput().send(messageBuilder.build());
                    break;
                case QUOTATION_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.QUOTATION_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.quotationOutput().send(messageBuilder.build());
                    break;
                case QUOTATION_REMIND:
                    //报价单到期提醒 走轮询
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CONTRACT_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CONTRACT_STAGE_PUSH:
                    header = PushTypeEnum.CONTRACT_STAGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.contractOutput().send(messageBuilder.build());
                    break;
                case CONTRACT_ADD_PUSH:
                    header = PushTypeEnum.CONTRACT_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.contractOutput().send(messageBuilder.build());
                    break;
                case CONTRACT_CHANGE_PUSH:
                    header = PushTypeEnum.CONTRACT_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.contractOutput().send(messageBuilder.build());
                    break;
                case CONTRACT_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.CONTRACT_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.contractOutput().send(messageBuilder.build());
                    break;
                case CONTRACT_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.CONTRACT_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.contractOutput().send(messageBuilder.build());
                    break;
                case CONTRACT_REMIND:
                    //合同到期提醒 走轮询  @date 2019/2/25 16:06  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PAYMENT_PLAN_ADD:
                    header = PushTypeEnum.PAYMENT_PLAN_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentOutput().send(messageBuilder.build());
                    break;
                case PAYMENT_SHEET_ADD:
                    header = PushTypeEnum.PAYMENT_SHEET_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentOutput().send(messageBuilder.build());
                    break;
                case PAYMENT_SHEET_RED_ADD:
                    header = PushTypeEnum.PAYMENT_SHEET_RED_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentOutput().send(messageBuilder.build());
                    break;
                case PAYMENT_SHEET_BAD_ADD:
                    header = PushTypeEnum.PAYMENT_SHEET_BAD_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentOutput().send(messageBuilder.build());
                    break;
                case PAYMENT_SHEET_PREPAYMENT_ADD:
                    header = PushTypeEnum.PAYMENT_SHEET_PREPAYMENT_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentOutput().send(messageBuilder.build());
                    break;
                case PAYMENT_SHEET_RED_PREPAYMENT_ADD:
                    header = PushTypeEnum.PAYMENT_SHEET_RED_PREPAYMENT_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentOutput().send(messageBuilder.build());
                    break;
                case PAYMENT_REMIND:
                    //未回款提醒 走轮询  @date 2019/2/25 16:06  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PAYMENT_OVERDUE:
                    //逾期回款提醒 走轮询  @date 2019/2/25 16:06  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case INVOICE_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case INVOICE_ADD_PUSH:
                    header = PushTypeEnum.INVOICE_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.invoiceOutput().send(messageBuilder.build());
                    break;
                case INVOICE_DEL_PUSH:
                    header = PushTypeEnum.INVOICE_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.invoiceOutput().send(messageBuilder.build());
                    break;
                case INVOICE_REDUCTION:
                    header = PushTypeEnum.INVOICE_REDUCTION;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.invoiceOutput().send(messageBuilder.build());
                    break;
                case INVOICE_INVALIDATION:
                    header = PushTypeEnum.INVOICE_INVALIDATION;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.invoiceOutput().send(messageBuilder.build());
                    break;
                case INVOICE_RED_ADD_PUSH:
                    header = PushTypeEnum.INVOICE_RED_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.invoiceOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_INVOICE_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PURCHASE_INVOICE_ADD_PUSH:
                    header = PushTypeEnum.PURCHASE_INVOICE_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.purchaseInvoiceOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_INVOICE_DEL_PUSH:
                    header = PushTypeEnum.PURCHASE_INVOICE_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.purchaseInvoiceOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_INVOICE_REDUCTION:
                    header = PushTypeEnum.PURCHASE_INVOICE_REDUCTION;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.purchaseInvoiceOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_INVOICE_INVALIDATION:
                    header = PushTypeEnum.PURCHASE_INVOICE_INVALIDATION;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.purchaseInvoiceOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_INVOICE_RED_ADD_PUSH:
                    header = PushTypeEnum.PURCHASE_INVOICE_RED_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.purchaseInvoiceOutput().send(messageBuilder.build());
                    break;
                case STATEMENT_GENERATE_PUSH:
                    header = PushTypeEnum.STATEMENT_GENERATE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.statementOutput().send(messageBuilder.build());
                    break;
                case STATEMENT_REMIND_CONFIRM_PUSH:
                    header = PushTypeEnum.STATEMENT_REMIND_CONFIRM_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.statementOutput().send(messageBuilder.build());
                    break;
                case STATEMENT_VALET_CONFIRM_PUSH:
                    header = PushTypeEnum.STATEMENT_VALET_CONFIRM_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.statementOutput().send(messageBuilder.build());
                    break;
                case STATEMENT_REGENERATE_PUSH:
                    header = PushTypeEnum.STATEMENT_REGENERATE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.statementOutput().send(messageBuilder.build());
                    break;
                case STATEMENT_QUESTION_FEEDBACK_PUSH:
                    header = PushTypeEnum.STATEMENT_QUESTION_FEEDBACK_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.statementOutput().send(messageBuilder.build());
                    break;
                case CREDIT_FIXED_LIMIT_CHANGE_PUSH:
                    header = PushTypeEnum.CREDIT_FIXED_LIMIT_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.creditOutput().send(messageBuilder.build());
                    break;
                case SALE_REPORT_PUSH:
                    //销售简报 走轮询  @date 2019/2/25 16:06  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case COMMUNICATE_PLAN_REMIND:
                    //目前还没使用  @date 2019/2/25 17:09  @author 魏荣杰
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case WORK_REPORT_PUSH:
                    header = PushTypeEnum.WORK_REPORT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case WORK_REPORT_ADD_PUSH:
                    header = PushTypeEnum.WORK_REPORT_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case WORK_REPORT_COMMENT_PUSH:
                    header = PushTypeEnum.WORK_REPORT_COMMENT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case WORK_REPORT_COMMENT_LIKE_PUSH:
                    header = PushTypeEnum.WORK_REPORT_COMMENT_LIKE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case WORK_REPORT_COMMENT_UNREAD_PUSH:
                    header = PushTypeEnum.WORK_REPORT_COMMENT_UNREAD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case WORK_REPORT_AT_PUSH:
                    header = PushTypeEnum.WORK_REPORT_AT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case WORK_REPORT_COMMENT_DEL_PUSH:
                    header = PushTypeEnum.WORK_REPORT_COMMENT_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.workReportOutput().send(messageBuilder.build());
                    break;
                case SIGN_IN_ADD_PUSH:
                    header = PushTypeEnum.SIGN_IN_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.signInOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case WAIT_PURCHASE_PUSH:
                    header = PushTypeEnum.WAIT_PURCHASE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.purchaseOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_SUCCESS_PUSH:
                    header = PushTypeEnum.PURCHASE_SUCCESS_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.purchaseOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.PURCHASE_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.purchaseOutput().send(messageBuilder.build());
                    break;
                case PURCHASE_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.PURCHASE_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.purchaseOutput().send(messageBuilder.build());
                    break;
                case INSTOCK_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case WAIT_INSTOCK_PUSH:
                    header = PushTypeEnum.WAIT_INSTOCK_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.instockOutput().send(messageBuilder.build());
                    break;
                case INSTOCK_SUCCESS_PUSH:
                    header = PushTypeEnum.INSTOCK_SUCCESS_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.instockOutput().send(messageBuilder.build());
                    break;
                case OUTSTOCK_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case WAIT_OUTSTOCK_PUSH:
                    header = PushTypeEnum.WAIT_OUTSTOCK_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.outstockOutput().send(messageBuilder.build());
                    break;
                case OUTSTOCK_SUCCESS_PUSH:
                    header = PushTypeEnum.OUTSTOCK_SUCCESS_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.outstockOutput().send(messageBuilder.build());
                    break;
                case SUPPLIER_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case SUPPLIER_ADD_PUSH:
                    header = PushTypeEnum.OUTSTOCK_SUCCESS_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.supplierOutput().send(messageBuilder.build());
                    break;
                case SUPPLIER_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.SUPPLIER_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.supplierOutput().send(messageBuilder.build());
                    break;
                case SUPPLIER_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.SUPPLIER_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.supplierOutput().send(messageBuilder.build());
                    break;
                case BOMBILL_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case BOMBILL_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.BOMBILL_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.bomOutput().send(messageBuilder.build());
                    break;
                case BOMBILL_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.BOMBILL_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.bomOutput().send(messageBuilder.build());
                    break;
                case PRODUCTION_ORDER_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PRODUCTION_ORDER_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.PRODUCTION_ORDER_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.productionOrderOutput().send(messageBuilder.build());
                    break;
                case PRODUCTION_ORDER_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.PRODUCTION_ORDER_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    jxcBinder.productionOrderOutput().send(messageBuilder.build());
                    break;
                /*case REFUND_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case REFUND_ADD_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case REFUND_ADD_WITH_PRODUCT_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case REFUND_ADD_WITHOUT_PRODUCT_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);*/
                case RETURNED_PURCHASE_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case APPROVAL_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case APPROVAL_ADD_PUSH:
                    header = PushTypeEnum.APPROVAL_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_CHANGE_PUSH:
                    header = PushTypeEnum.APPROVAL_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_NODE_CHANGE_PUSH:
                    header = PushTypeEnum.APPROVAL_NODE_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_AGREE_PUSH:
                    header = PushTypeEnum.APPROVAL_AGREE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_REFUSE_PUSH:
                    header = PushTypeEnum.APPROVAL_REFUSE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_REEDIT_PUSH:
                    header = PushTypeEnum.APPROVAL_REEDIT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_CARBON_COPY_PUSH:
                    header = PushTypeEnum.APPROVAL_CARBON_COPY_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_COMMENT_AT:
                    header = PushTypeEnum.APPROVAL_COMMENT_AT;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_COMMENT_EDIT:
                    header = PushTypeEnum.APPROVAL_COMMENT_EDIT;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_COMMENT_DEL:
                    header = PushTypeEnum.APPROVAL_COMMENT_DEL;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workflowOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_PUSH:
                    header = PushTypeEnum.WORKORDER_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_DEL_PUSH:
                    header = PushTypeEnum.WORKORDER_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_DYNAMIC_PUSH:
                    header = PushTypeEnum.WORKORDER_DYNAMIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_DYNAMIC_UPDATE_PUSH:
                    header = PushTypeEnum.WORKORDER_DYNAMIC_UPDATE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_DYNAMIC_DEL_PUSH:
                    header = PushTypeEnum.WORKORDER_DYNAMIC_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_NEW_EXECUTOR:
                    header = PushTypeEnum.WORKORDER_NEW_EXECUTOR;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_NEW_EXECUTED:
                    header = PushTypeEnum.WORKORDER_NEW_EXECUTED;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_CONFIRM:
                    header = PushTypeEnum.WORKORDER_CONFIRM;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_TEAM:
                    header = PushTypeEnum.WORKORDER_TEAM;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_STAGE_COMPLETE:
                    header = PushTypeEnum.WORKORDER_STAGE_COMPLETE;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_COMPLETE:
                    header = PushTypeEnum.WORKORDER_COMPLETE;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_CLOSE:
                    header = PushTypeEnum.WORKORDER_CLOSE;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_RESTART:
                    header = PushTypeEnum.WORKORDER_RESTART;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_TRANSFER:
                    header = PushTypeEnum.WORKORDER_TRANSFER;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_ROLLBACK:
                    header = PushTypeEnum.WORKORDER_ROLLBACK;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_COMMENT_LIKE_PUSH:
                    header = PushTypeEnum.WORKORDER_COMMENT_LIKE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_COMMENT_PUSH:
                    header = PushTypeEnum.WORKORDER_COMMENT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_COMMENT_AT:
                    header = PushTypeEnum.WORKORDER_COMMENT_AT;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case WORKORDER_COMMENT_DEL_PUSH:
                    header = PushTypeEnum.WORKORDER_COMMENT_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.workOrderOutput().send(messageBuilder.build());
                    break;
                case APPROVAL_PUSH_ADD_COMMENT:
                    header = PushTypeEnum.APPROVAL_PUSH_ADD_COMMENT;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.approvalOutput().send(messageBuilder.build());
                    break;
                case SFA_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case SFA_CUSTOMER_PUSH:
                    header = PushTypeEnum.SFA_CUSTOMER_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    sfaBinder.sfaCustomerOutput().send(messageBuilder.build());
                    break;
                case SFA_OPPORTUNITY_PUSH:
                    header = PushTypeEnum.SFA_OPPORTUNITY_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    sfaBinder.sfaOpportunityOutput().send(messageBuilder.build());
                    break;
                case SFA_CONTRACT_PUSH:
                    header = PushTypeEnum.SFA_CONTRACT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    sfaBinder.sfaContractOutput().send(messageBuilder.build());
                    break;
                case SFA_CONTACT_PUSH:
                    header = PushTypeEnum.SFA_CONTACT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    sfaBinder.sfaContactOutput().send(messageBuilder.build());
                    break;
                case SYSTEM_PUSH:
                    // TODO: 2019/2/25
                    break;
                case EXPIRED_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case EXPORT_PUSH:
                    header = PushTypeEnum.EXPORT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.downloadOutput().send(messageBuilder.build());
                    break;
                case EXPORT_PUSH_FAIL:
                    header = PushTypeEnum.EXPORT_PUSH_FAIL;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    officeBinder.downloadOutput().send(messageBuilder.build());
                    break;
                case PAY_PLAN_ADD:
                    header = PushTypeEnum.PAY_PLAN_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.payPlanOutPut().send(messageBuilder.build());
                    break;
                case PAY_PLAN_REMIND:
                    //未付款提醒 走轮询
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PAY_PLAN_OVERDUE:
                    //逾期付款提醒 走轮询
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PAY_SHEET_ADD:
                    header = PushTypeEnum.PAY_SHEET_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.payPlanOutPut().send(messageBuilder.build());
                    break;
                case PAY_SHEET_RED_ADD:
                    header = PushTypeEnum.PAY_SHEET_RED_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.payPlanOutPut().send(messageBuilder.build());
                    break;
                case PAY_SHEET_BAD_ADD:
                    header = PushTypeEnum.PAY_SHEET_BAD_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.payPlanOutPut().send(messageBuilder.build());
                    break;
                case PAY_SHEET_PREPAY_ADD:
                    header = PushTypeEnum.PAY_SHEET_PREPAY_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.payPlanOutPut().send(messageBuilder.build());
                    break;
                case PAY_SHEET_RED_PREPAY_ADD:
                    header = PushTypeEnum.PAY_SHEET_RED_PREPAY_ADD;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.payPlanOutPut().send(messageBuilder.build());
                    break;
                case PAYMENT_TASK_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case PAYMENT_TASK_ADD_PUSH:
                    header = PushTypeEnum.PAYMENT_TASK_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    crmBinder.paymentTaskOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_ADD_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_HANDOVER_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_HANDOVER_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorHandoverOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_TEAM_ADD_DEL_MAIN:
                    header = PushTypeEnum.DISTRIBUTOR_TEAM_ADD_DEL_MAIN;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_TEAM_ADD_DEL_SYNERGETIC:
                    header = PushTypeEnum.DISTRIBUTOR_TEAM_ADD_DEL_SYNERGETIC;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COMMUNICATE_ADD_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COMMUNICATE_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorCommunicateOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COMMUNICATE_LIKE_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COMMUNICATE_LIKE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorCommunicateOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COMMUNICATE_COMMENT_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COMMUNICATE_COMMENT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorCommunicateOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COMMUNICATE_COMMENT_DEL_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COMMUNICATE_COMMENT_DEL_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorCommunicateOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COMMUNICATE_AT_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COMMUNICATE_AT_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorCommunicateOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_CONTACT_ADD_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_CONTACT_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    distributorProducerBinder.distributorContactOutput().send(messageBuilder.build());
                    break;
                case ORDER_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case ORDER_ADD_PUSH:
                    header = PushTypeEnum.ORDER_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case ORDER_CHANGE_PUSH:
                    header = PushTypeEnum.ORDER_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case ORDER_TEAM_ADD_DEL_MAIN_PUSH:
                    header = PushTypeEnum.ORDER_TEAM_ADD_DEL_MAIN_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case ORDER_TEAM_ADD_DEL_SYNERGETIC_PUSH:
                    header = PushTypeEnum.ORDER_TEAM_ADD_DEL_SYNERGETIC_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_ORDER_PUSH:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case DISTRIBUTOR_ORDER_ADD_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_ORDER_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_ORDER_REVIEW_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_ORDER_REVIEW_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_ORDER_ABANDONED_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_ORDER_ABANDONED_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_ORDER_CLOSE_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_ORDER_CLOSE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_ORDER_SHIP_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_ORDER_SHIP_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.orderOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_REFUND_REVIEW_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_REFUND_REVIEW_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.distributorRefundOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_REFUND_ABANDONED_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_REFUND_ABANDONED_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.distributorRefundOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_REFUND_CLOSE_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_REFUND_CLOSE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    orderCenterProducerBinder.distributorRefundOutput().send(messageBuilder.build());
                    break;
                case MARKETING_ACTIVITY_MANAGEMENT_ONLINE_PUSH:
                    header = PushTypeEnum.MARKETING_ACTIVITY_MANAGEMENT_ONLINE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketingManagementProducerBinder.marketingManagementOutput().send(messageBuilder.build());
                    break;
                case PROMOTION_ACTIVITY_MANAGEMENT_ONLINE_PUSH:
                    header = PushTypeEnum.PROMOTION_ACTIVITY_MANAGEMENT_ONLINE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketingManagementProducerBinder.promotionManagementOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_MARKETING_ACTIVITY_MANAGEMENT_ONLINE_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_MARKETING_ACTIVITY_MANAGEMENT_ONLINE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketingManagementProducerBinder.distributorMarketingManagementOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_PROMOTION_ACTIVITY_MANAGEMENT_ONLINE_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_PROMOTION_ACTIVITY_MANAGEMENT_ONLINE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketingManagementProducerBinder.distributorPromotionManagementOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COUPON_GET_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COUPON_GET_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketingManagementProducerBinder.distributorCouponOutput().send(messageBuilder.build());
                    break;
                case DISTRIBUTOR_COUPON_USE_PUSH:
                    header = PushTypeEnum.DISTRIBUTOR_COUPON_USE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketingManagementProducerBinder.distributorCouponOutput().send(messageBuilder.build());
                    break;
                case CLUE_PUSH:
                    //目前不使用  @date 2020/12/24 16:05  @author 陈有利
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CLUE_ADD_PUSH:
                    header = PushTypeEnum.CLUE_ADD_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueOutput().send(messageBuilder.build());
                    break;
                case CLUE_CHANGE_PUSH:
                    header = PushTypeEnum.CLUE_CHANGE_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueOutput().send(messageBuilder.build());
                    break;
                case CLUE_HANDOVER_PUSH:
                    header = PushTypeEnum.CLUE_HANDOVER_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueHandoverOutput().send(messageBuilder.build());
                    break;
                case CLUE_DISTRIBUTION_PUSH:
                    header = PushTypeEnum.CLUE_DISTRIBUTION_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueDistributionOutput().send(messageBuilder.build());
                    break;
                case CLUE_BACK_PUBLIC:
                    // 无，该枚举为推送配置枚举，不是实际推送用枚举
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CLUE_TEAM_ADD_DEL_MAIN:
                    header = PushTypeEnum.CLUE_TEAM_ADD_DEL_MAIN;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueOutput().send(messageBuilder.build());
                    break;
                case CLUE_TEAM_ADD_DEL_SYNERGETIC:
                    header = PushTypeEnum.CLUE_TEAM_ADD_DEL_SYNERGETIC;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueOutput().send(messageBuilder.build());
                    break;
                case CLUE_STAGE:
                    header = PushTypeEnum.CLUE_STAGE;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    marketActivityBinder.clueOutput().send(messageBuilder.build());
                    break;
                case CLUE_BACK_PUSH:
                    // TODO: 2020/12/24
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case CLUE_WILL_BACK_PUSH:
                    // TODO: 2020/12/24
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                case DATA_WARNING_PUSH:
                    header = PushTypeEnum.DATA_WARNING_PUSH;
                    messageHeaderAccessor.setHeader(HEADER_NAME, header);
                    messageBuilder = MessageBuilder.withPayload(message).setHeaders(messageHeaderAccessor);
                    dataCenterProducerBinder.dataWarningOutput().send(messageBuilder.build());
                    break;
                case UNKNOWN:
                    throw new XbbException(MessageErrorCodeEnum.API_ERROR_380001);
                default:
                    break;
            }
        }
    }
}
